package org.example.springbootserver.controller;

import lombok.RequiredArgsConstructor;
import org.example.springbootserver.pojo.R;
import org.example.springbootserver.pojo.User;
import org.example.springbootserver.service.UserService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/User")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @PostMapping("/login")
    public R Login(@RequestBody User user){
        return userService.Login(user);
    }

    @PostMapping("/register")
    public R Register(@RequestBody User user,@RequestParam String verification){
        return userService.Register(user,verification);
    }

}
